<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>dui</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@3.0.3/dist/vue.global.prod.js"></script>
  <!-- <link rel="stylesheet" href="../dist/dui.min.css"> -->
  <link rel="stylesheet" href="../dist/dui.base.min.css">
  <link rel="stylesheet" href="../dist/actionsheet.min.css">
  <link rel="stylesheet" href="../dist/dialog.min.css">
  <link rel="stylesheet" href="../dist/preview.min.css">
  <style>
    .grid .square img {
      vertical-align: middle;
      object-fit: cover;
      background-color: #f1f1f1;
    }
  </style>
</head>
<body>
  <div class="dui-page" id="app">
    <dui-refresh @refresh="onRefresh">
      <div class="plr ptb-sm">图片预览</div>
      <div class="grid bg-white plr">
        <div class="col-4 square xs radius" v-for="(img, index) in imgPaths" :key="index" @click="preview(imgPaths, index)">
          <img class="abs" :src="img" referrerpolicy="no-referrer">
        </div>
      </div>
      <!-- list -->
      <div class="plr ptb-sm">功能列表</div>
      <div class="dui-list bg-white">
        <div class="dui-item mlr" @click="dialog({ title: '标题', content: '您好吗' })">dialog</div>
        <div class="dui-item mlr" @click="actionsheet(['一', '二'], { title: '标题' })">actionsheet</div>
      </div>
    </dui-refresh>
  </div>

  <!-- <script src="../dist/dui.min.js"></script> -->
  <script src="../dist/preview.min.js"></script>
  <script src="../dist/actionsheet.min.js"></script>
  <script src="../dist/dialog.min.js"></script>
  <script src="../dist/refresh.min.js"></script>
  <script>
    var app = Vue.createApp({
      setup: function () {
        return {
          content: 'Hello Dui',
          imgPaths: [
            'http://b-ssl.duitang.com/uploads/item/201410/09/20141009224754_AswrQ.jpeg',
            'https://c-ssl.duitang.com/uploads/item/202003/08/20200308000020_ECSFH.thumb.1000_0.jpeg',
            'https://c-ssl.duitang.com/uploads/item/202007/17/20200717131129_tTkGB.thumb.1000_0.jpeg',
            'https://c-ssl.duitang.com/uploads/item/201808/13/20180813200538_vqnje.thumb.700_0.jpeg',
            'https://c-ssl.duitang.com/uploads/item/202005/26/20200526000816_sLrLa.thumb.700_0.jpeg',
            'https://c-ssl.duitang.com/uploads/item/202001/03/20200103105513_yzcxj.thumb.700_0.jpeg',
            'https://c-ssl.duitang.com/uploads/item/202004/20/20200420210204_vxdjh.thumb.700_0.png',
          ],
          preview,
          actionsheet,
          dialog,
          onRefresh(finished) {
            return new Promise((resolve) => {
              setTimeout(() => {
                finished(true);
              }, 2000);
            });
          },
        };
      },
    });

    app.use(refresh);

    app.mount('#app');
  </script>
</body>
</html>
